<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>无标题文档</title>
		<!--框架必需start-->
		<script type="text/javascript" src="../../libs/js/jquery.js"></script>
		<script type="text/javascript" src="../../libs/js/language/cn.js"></script>
		<script type="text/javascript" src="../../libs/js/framework.js"></script>
		<link href="../../libs/css/import_basic.css" rel="stylesheet" type="text/css" />
		<link rel="stylesheet" type="text/css" id="skin" prePath="../../" />
		<link rel="stylesheet" type="text/css" id="customSkin" />
		<!--框架必需end-->
		<link rel="stylesheet" type="text/css" href="style/style.css" />

		<script src="../../libs/js/table/quiGrid.js" type="text/javascript"></script>

		<style type="text/css">
			/*body {
				background: #fff;
			}*/
		</style>
	</head>

	<body>
		<div class="page_content">
			<div class="demo_operation">
				<input type="button" value="单据录入" class="primary" onclick="window.location='oa_02.html'" />
			</div>
			<div class="infoCard infoCard2">
				<div class="title">
					<span>信息添加</span>
				</div>
				<div class="attendance_list_operation">
					<table border="0" cellspacing="0" cellpadding="0" class="search_content">
						<tr>
							<td>搜索：</td>
							<td><input type="text" /></td>
							<td><input type="button" value="搜索" class="" /></td>
						</tr>
					</table>
					<div class="clear"></div>
				</div>
				<div id="dataBasic"></div>
			</div>
		</div>

		<script type="text/javascript">
			var grid = null;
			//数据表格使用
			var gridData = {
				"form.paginate.pageNo": 1,
				"form.paginate.totalRows": 13,
				"rows": [{
						"id": 5418,
						"content": "调休",
						"type": "请假申请",
						"StartingTime": "2012-08-29 上午",
						"EndTime": "2012-08-30 下午",
						"Days": 2,
						"State": "审批通过"
					}, {
						"id": 5418,
						"content": "调休",
						"type": "加班申请",
						"StartingTime": "2012-08-29 上午",
						"EndTime": "2012-08-30 下午",
						"Days": 2,
						"State": "审批通过"
					}, {
						"id": 5418,
						"content": "调休",
						"type": "请假申请",
						"StartingTime": "2012-08-29 上午",
						"EndTime": "2012-08-30 下午",
						"Days": 2,
						"State": "审批通过"
					}, {
						"id": 5418,
						"content": "调休",
						"type": "请假申请",
						"StartingTime": "2012-08-29 上午",
						"EndTime": "2012-08-30 下午",
						"Days": 2,
						"State": "审批通过"
					}, {
						"id": 5418,
						"content": "调休",
						"type": "请假申请",
						"StartingTime": "2012-08-29 上午",
						"EndTime": "2012-08-30 下午",
						"Days": 2,
						"State": "审批通过"
					}, {
						"id": 5418,
						"content": "调休",
						"type": "请假申请",
						"StartingTime": "2012-08-29 上午",
						"EndTime": "2012-08-30 下午",
						"Days": 2,
						"State": "审批不通过"
					}, {
						"id": 5418,
						"content": "调休",
						"type": "加班申请",
						"StartingTime": "2012-08-29 上午",
						"EndTime": "2012-08-30 下午",
						"Days": 2,
						"State": "审批通过"
					}, {
						"id": 5418,
						"content": "调休",
						"type": "请假申请",
						"StartingTime": "2012-08-29 上午",
						"EndTime": "2012-08-30 下午",
						"Days": 2,
						"State": "审批通过"
					}, {
						"id": 5418,
						"content": "调休",
						"type": "请假申请",
						"StartingTime": "2012-08-29 上午",
						"EndTime": "2012-08-30 下午",
						"Days": 2,
						"State": "审批通过"
					}, {
						"id": 5418,
						"content": "调休",
						"type": "外勤申请",
						"StartingTime": "2012-08-29 上午",
						"EndTime": "2012-08-30 下午",
						"Days": 2,
						"State": "审批通过"
					}

				]
			}

			function initComplete() {
				grid = $("#dataBasic").quiGrid({
					columns: [{
							display: '编号',
							name: 'id',
							width: "10%",
							cellClick: true
						},
						{
							display: '申请内容',
							name: 'content',
							width: "20%"
						},
						{
							display: '单据类型',
							name: 'type',
							width: "10%",
							render: function(rowdata, rowindex, value, column) {
								return "请假申请" == value ? "<font color='#4CC0C1'>" + value + "</font>" : "<font color='#8EC165'>" + value + "</font>";
							}
						},
						{
							display: '起始时间',
							name: 'StartingTime',
							width: "20%"
						},
						{
							display: '结束时间',
							name: 'EndTime',
							width: "20%"
						},
						{
							display: '天数',
							name: 'Days',
							width: "10%"
						},
						{
							display: '审批状态',
							name: 'State',
							width: "10%",
							render: function(rowdata, rowindex, value, column) {
								return "审批通过" == value ? "<font color='#8EC165'>" + value + "</font>" : "<font color='#FB6B5B'>" + value + "</font>";
							}
						},
						{
							display: '操作',
							name: 'name',
							align: 'center',
							width: 120,
							render: function(rowdata, rowindex, value, column) {
								var mainCon = $('<div></div>');
								var con = $('<div class="popupMenu"><div class="popupMenu_link"><a href="javascript:;" class="themeBgColor">操作</a></div><div class="popupMenu_con white_con"><a href="javascript:;" onclick="examination(0)"><span>通过</span></a><a href="javascript:;" onclick="examination(1)"><span>不通过</span></a></div></div>');
								mainCon.append(con);
								return mainCon.html();
							}
						}
					],
					data: gridData,
					sortName: 'id',
					rownumbers: false,
					checkbox: false,
					height: '100%',
					width: "100%",
					pageSize: 10,
					percentWidthMode: true,
					onAfterShowData: onAfterShowData

				});
			}
			//修改
			function onEdit(rowid) {
				top.Toast("showNoticeToast", "见JAVA版或.NET版演示。");
			}

			//删除
			function onDelete(rowid, rowidx) {
				top.Dialog.confirm("确定要删除该记录吗？", function() {
					top.Toast("showNoticeToast", "向后台发送ajax请求来删除。见JAVA版或.NET版演示。");
				});
			}

			function onAfterShowData(data) {

				$("#dataBasic").find(".popupMenu").each(function() {
					$(this).hover(function() {
						$(this).find(".popupMenu_con").show();
					}, function() {
						$(this).find(".popupMenu_con").hide();
					});
				})
			}
			function examination(idx){
				if(idx==0){
					top.Toast("showNoticeToast", "通过审批");
				}else{
					top.Toast("showNoticeToast", "不通过审批");
				}
			}
		</script>
	</body>

</html>